#include<stdio.h>
#include"ntp.h"

struct tm* result;

int main() {
    char * server_list[] = {
        "windows.com",
        "time.windows.com",
    };
    for(int i = 0; i < sizeof(server_list) / sizeof(server_list[0]); i++){
        result = ntp_get_time(server_list[i]);
        if (result) {
            printf("ntp get time succed:%s.[From %s]\n", asctime(result), server_list[i]);
            return 0;
        }
        printf("ntp get time failed from %s\n", server_list[i]);
    }

    printf("ntp get time failed from all server\n");
    return -1;
}